package com.wx.cloud.dailyreport.controller;

import com.wx.cloud.dailyreport.common.CommonResult;
import com.wx.cloud.dailyreport.service.DailyreportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RefreshScope
@RestController
@RequestMapping("/dailyreport")
public class DailyreportController {

    @Value("${test}")
    private String test;


    @Autowired
    private DailyreportService dailyreportService;
    @GetMapping("/getDailyreportsByUserName")
    public CommonResult getDailyreportsByUserName(@RequestParam String name){
        return dailyreportService.getDailyreportsByUserName(name);
    }

    @GetMapping("/test")
    public CommonResult tests(){
        return CommonResult.success(test);
    }
}
